package com.cheejee.goodscenter.module.dto;

import java.math.BigDecimal;
import java.util.List;

import javax.validation.Valid;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.springframework.validation.annotation.Validated;

import com.cheejee.goodscenter.module.entity.GoodsSpecific;
import com.cheejee.goodscenter.module.entity.SkuBrandProperties;
import com.cheejee.goodscenter.module.entity.SkuCategoryProperties;
import com.cheejee.goodscenter.module.entity.SkuCustomProperties;
import com.cheejee.goodscenter.validated.InsertGroup;
import com.cheejee.goodscenter.validated.UpdateGroup;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author CARRY
 * @Date 2020年10月28日下午10:51:34
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SkuDto {
	
	private Long id; 
	
	@NotNull(message = "SKU价格不能为空", groups = {UpdateGroup.class, InsertGroup.class})
    private BigDecimal price;

	@NotNull(message = "SKU库存不能为空", groups = {UpdateGroup.class, InsertGroup.class})
    private Integer stock;

    private String pic;

    private Integer sale;

    @NotNull(message = "SKU上架状态不能为空", groups = {UpdateGroup.class, InsertGroup.class})
    private Boolean isOn;

    private String webDetail;

    private String mobileDetail;
    
	@Size(max = 5, message = "SKU规格不能超过5级", groups = {UpdateGroup.class, InsertGroup.class})
	@NotEmpty(message = "SKU规格不能为空", groups = InsertGroup.class)
    private List<SkuSpecificDto> specific;
    
    private List<SkuBrandProperties> brandProperties; 
    
    private List<SkuCategoryProperties> categoryProperties; 
    
    private List<SkuCustomProperties> customProperties; 
    
}
